home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MPW_TOOL / TOOLS / TOOLS_WI / PERL / UNTESTED / X2P / MAKEFILE.SH < prev    next >
Text File  |  1992-01-05  |  3KB  |  154 lines

  1. case "$0" in
  2. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  3. esac
  4. case $CONFIG in
  5. '')
  6.     if test ! -f config.sh; then
  7.     ln ../config.sh . || \
  8.     ln -s ../config.sh . || \
  9.     ln ../../config.sh . || \
  10.     ln ../../../config.sh . || \
  11.     (echo "Can't find config.sh."; exit 1)
  12.     fi 2>/dev/null
  13.     . ./config.sh
  14.     ;;
  15. esac
  16. echo "Extracting x2p/Makefile (with variable substitutions)"
  17. cat >Makefile <<!GROK!THIS!
  18. # $RCSfile: Makefile.SH,v $$Revision: 4.0.1.2 $$Date: 91/11/05 19:19:04 $
  19. #
  20. # $Log:    Makefile.SH,v $
  21. # Revision 4.0.1.2  91/11/05  19:19:04  lwall
  22. # patch11: random cleanup
  23. # Revision 4.0.1.1  91/06/07  12:12:14  lwall
  24. # patch4: cflags now emits entire cc command except for the filename
  25. # Revision 4.0  91/03/20  01:57:03  lwall
  26. # 4.0 baseline.
  27.  
  28. CC = $cc
  29. YACC = $yacc
  30. bin = $bin
  31. lib = $lib
  32. mansrc = $mansrc
  33. manext = $manext
  34. LDFLAGS = $ldflags
  35. SMALL = $small
  36. LARGE = $large $split
  37. mallocsrc = $mallocsrc
  38. mallocobj = $mallocobj
  39.  
  40. libs = $libs
  41. !GROK!THIS!
  42.  
  43. cat >>Makefile <<'!NO!SUBS!'
  44.  
  45. CCCMD = `sh cflags $@`
  46.  
  47. public = a2p s2p find2perl
  48.  
  49. private = 
  50.  
  51. manpages = a2p.man s2p.man
  52.  
  53. util =
  54.  
  55. sh = Makefile.SH makedepend.SH
  56.  
  57. h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h
  58.  
  59. c = hash.c $(mallocsrc) str.c util.c walk.c
  60.  
  61. obj = hash.o $(mallocobj) str.o util.o walk.o
  62.  
  63. lintflags = -phbvxac
  64.  
  65. addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
  66.  
  67. # grrr
  68. SHELL = /bin/sh
  69.  
  70. .c.o:
  71.     $(CCCMD) $*.c
  72.  
  73. all: $(public) $(private) $(util)
  74.     touch all
  75.  
  76. a2p: $(obj) a2p.o
  77.     $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
  78.  
  79. a2p.c: a2p.y
  80.     @ echo Expect 226 shift/reduce conflicts...
  81.     $(YACC) a2p.y
  82.     mv y.tab.c a2p.c
  83.  
  84. a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
  85.     $(CCCMD) $(LARGE) a2p.c
  86.  
  87. install: a2p s2p
  88. # won't work with csh
  89.     export PATH || exit 1
  90.     - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
  91.     - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
  92.     - if test `pwd` != $(bin); then cp $(public) $(bin); fi
  93.     cd $(bin); \
  94. for pub in $(public); do \
  95. chmod +x `basename $$pub`; \
  96. done
  97.     - if test `pwd` != $(mansrc); then \
  98. for page in $(manpages); do \
  99. cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
  100. done; \
  101. fi
  102.  
  103. clean:
  104.     rm -f a2p *.o
  105.  
  106. realclean: clean
  107.     rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p find2perl all cflags
  108.  
  109. # The following lint has practically everything turned on.  Unfortunately,
  110. # you have to wade through a lot of mumbo jumbo that can't be suppressed.
  111. # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
  112. # for that spot.
  113.  
  114. lint:
  115.     lint $(lintflags) $(defs) $(c) > a2p.fuzz
  116.  
  117. depend: $(mallocsrc) ../makedepend
  118.     ../makedepend
  119.  
  120. clist:
  121.     echo $(c) | tr ' ' '\012' >.clist
  122.  
  123. hlist:
  124.     echo $(h) | tr ' ' '\012' >.hlist
  125.  
  126. shlist:
  127.     echo $(sh) | tr ' ' '\012' >.shlist
  128.  
  129. config.sh: ../config.sh
  130.     rm -f config.sh
  131.     ln ../config.sh .
  132.  
  133. malloc.c: ../malloc.c
  134.     sed 's/"perl.h"/"..\/perl.h"/' ../malloc.c >malloc.c
  135.  
  136. # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
  137. $(obj):
  138.     @ echo "You haven't done a "'"make depend" yet!'; exit 1
  139. makedepend: makedepend.SH
  140.     /bin/sh makedepend.SH
  141. !NO!SUBS!
  142. $eunicefix Makefile
  143. case `pwd` in
  144. *SH)
  145.     $rm -f ../Makefile
  146.     ln Makefile ../Makefile
  147.     ;;
  148. esac
  149. rm -f makefile
  150.